from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class Bace():
    def __init__(self):
        acp={
  "platformName": "Android",
  "deviceName": "emulator-5554",
  "automationName": "uiautomator2",
  "appPackage": "com.kongfz.app",
  "appActivity": ".home.mvvm.homepage.HomeActivity",
  "noReset": True
}
        self.driver=webdriver.Remote('htttp://127.0.0.1:4723/wd/hub',acp)
        self.driver.implicitly_wait(20)
    def dingwei(self,loc):
        ele=self.driver.find_element(*loc)
        return ele
    def jiesu(self):
        self.driver.quit()
    def jietu(self,loc):
        self.driver.save_screenshot(loc)
    def qingqiao(self,a,b):
        self.driver.tap(a,b)
    def xianshidengdai(self,loc):
        ele=WebDriverWait(self.driver,200).until(EC.element_to_be_clickable(loc))
        return ele